package com.qf.spring;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

//使用注解完成依赖注入
//注解注入其实是违反开闭原则的，它不利于扩展和维护，但优势就是代码量少
public class Demo03 {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(SpringConfiguration.class);
        Dog2 dog2 = applicationContext.getBean(Dog2.class);
//        Object dog22 = applicationContext.getBean("dog22");
        dog2.action();
    }
}
